import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';

@Injectable()
export class MemberService {
  private headers = new HttpHeaders().set('authorization', `Bearer ${localStorage.token}`);

  constructor(private http: HttpClient) { }

  getMember(params) {
    return this.http.get<any[]>(`/api/web/backend/members`, { headers: this.headers, params: params });
  }

  editMember(params) {
    return this.http.post<any[]>(`api/web/backend/members`, {headers: this.headers, params: params});
  }
}
